<?php

namespace App\Console;

use App\Models\Post\Post;
use App\Models\Post\PostComment;
use App\Models\Post\PostPraise;
use App\Models\Post\PostSta;
use App\Models\Shop\Shop;
use App\Models\Shop\ShopComment;
use App\Models\Shop\ShopStatistic;
use GuzzleHttp\Client;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Support\Facades\Log;
use Laravel\Lumen\Console\Kernel as ConsoleKernel;

class Kernel extends ConsoleKernel
{

    /**
     * The Artisan commands provided by your application.
     *
     * @var array
     */
    protected $commands = [
        //
    ];

    /**
     * Define the application's command schedule.
     *
     * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
     * @return void
     */
    protected function schedule(Schedule $schedule)
    {
        $schedule->call(function () {
            $client = new Client();
            $client->get('https://api.beboy.me/api/shopSta');
            $client->get('https://api.beboy.me/api/couponSta');
            $client->get('https://api.beboy.me/api/postSta');
            $client->get('https://api.beboy.me/api/checkVIP');
            $client->get('https://api.beboy.me/api/deleteDeadUsers');
            $client->get('https://api.beboy.me/api/cityStatistics');
            $client->get('https://api.beboy.me/api/shopWithdrawBatch');
            $client->get('https://api.beboy.me/api/userPointBatch');
        })->cron('5 0 * * * *');

        $schedule->call(function () {
            $client = new Client();
            $client->get('https://api.beboy.me/api/postReportSta');
            $client->get('https://api.beboy.me/api/shopHasHB');
            $client->get('https://api.beboy.me/api/userWithdrawBatch');
        })->cron('*/5 * * * * *');

        $schedule->call(function () {
            $client = new Client();
            $client->get('https://api.beboy.me/api/balance');
        })->cron('0 * * * * *');
    }
}
